package com.wjmj.balloon.debugger;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import com.wjmj.balloon.debugger.views.BreakpointView;
import com.wjmj.balloon.debugger.views.BrowserView;
import com.wjmj.balloon.debugger.views.ConsoleView;
import com.wjmj.balloon.debugger.views.DebugView;
import com.wjmj.balloon.debugger.views.VariableView;

public class Perspective implements IPerspectiveFactory {

	public static final String ID = "com.wjmj.balloon.debugger.Perspective";
	
	public void createInitialLayout(IPageLayout layout) {
		String editorArea = layout.getEditorArea();
		layout.setEditorAreaVisible(false);
		
		IFolderLayout console = layout.createFolder("Balloon Log", IPageLayout.BOTTOM, 0.7f, editorArea);
		console.addPlaceholder(ConsoleView.ID + ":*");
		console.addView(ConsoleView.ID);
		layout.getViewLayout(ConsoleView.ID).setCloseable(true);
		
		IFolderLayout browser = layout.createFolder("Balloon Browser", IPageLayout.BOTTOM, 0.5f, editorArea);
		browser.addPlaceholder(BrowserView.ID + ":*");
		browser.addView(BrowserView.ID);
		layout.getViewLayout(BrowserView.ID).setCloseable(true);
		
		IFolderLayout debug = layout.createFolder("Balloon Debug", IPageLayout.LEFT, 0.5f, editorArea);
		debug.addPlaceholder(DebugView.ID + ":*");
		debug.addView(DebugView.ID);
		layout.getViewLayout(DebugView.ID).setCloseable(true);
		
		IFolderLayout variables = layout.createFolder("Balloon Variables&BreakPoints", IPageLayout.RIGHT, 0.5f, editorArea);
		variables.addPlaceholder(VariableView.ID + ":*");
		variables.addView(VariableView.ID);
		layout.getViewLayout(VariableView.ID).setCloseable(true);
		variables.addPlaceholder(BreakpointView.ID + ":*");
		variables.addView(BreakpointView.ID);
		layout.getViewLayout(BreakpointView.ID).setCloseable(true);
		
	}
}
